<extend name="Public:base" />
<block name="title">通知公告</block>
<block name="content">
    <input type="hidden" name="page" id="page">
    <div class="page__bd">
        <div class="weui-panel__bd" id="searchResult">
            <!--<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg gonggao_a">
                <div class="weui-media-box__bd">
                    <h4 class="weui-media-box__title gonggao_tit">标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一标题一</h4>
                    <ul class="weui-media-box__info">
                        <li class="weui-media-box__info__meta">2017/5/10 </li>
                        <li class="weui-media-box__info__meta cor_red fr list_mor">查看详情</li>
                    </ul>
                </div>
            </a>-->
        </div>
        <div id="showmsg"></div>
        <input type="button" id="more" class="listmore" value="加载更多">
    </div>
    <script type="text/javascript">
        var page = $("#page").val();
        if(!page){
            page = 1;
        }
        notice_list(page);
        $("#more").click(function(){
            var page = $("#page").val();
            notice_list(page);
        });
        function notice_list(page){
            $.ajax({
                type:'post',
                url:'__MODULE__/Article/noticelist',
                data:{page:page},
                cache:false,
                dataType:'json',
                success:function(res){
                    if (res.code == 0) {
                        var arr = res.data;
                        var str = '';
                        $.each(arr, function (i) {
                        str += '<a href="__MODULE__/Article/noticedetail/id/' + this.id + '" class="weui-media-box weui-media-box_appmsg gonggao_a"><div class="weui-media-box__bd"><h4 class="weui-media-box__title gonggao_tit">' + this.title + '</h4><ul class="weui-media-box__info"><li class="weui-media-box__info__meta">' + this.addtime + ' </li><li class="weui-media-box__info__meta cor_red fr list_mor">查看详情</li></ul></div></a>';
                        });
                        $("#page").val(res.page);
                        $("#searchResult").append(str);
                    } else {
                        var str2 = '';
                        str2 += '<div class="nomore"><p>' + res.msg + '</p></div>';
                        $("#searchResult").append(str2);
                        $("#more").hide();
                    }
                }
            });
        }
    </script>
</block>